package cn.dlc.com.order.feign;

import cn.dlc.com.order.controller.FallBackClass;
import cn.dlc.com.order.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 邓立川
 * @date 2021/1/3 12:30
 * @desc 接口类
 */
// feign整合sentinel方式1. 通过fallback指定ProductServiceFallback。需要放开ProductServiceFallback中的@Component注解
//@FeignClient(value="product-server",fallback = ProductServiceFallback.class)
@FeignClient(value="product-server",fallbackFactory = ProductServiceFallbackFactory.class)
public interface ProductService {

    @GetMapping("/product/{id}")
    Product findById(@PathVariable("id") String id);
}
